package com.advice;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;

public class ExceptionService implements ThrowsAdvice{
    /**
     * 异常抛出增强
     *
     */
    public void afterThrowing(Method method, Object[] args, Object target, Exception e) throws Throwable{
        System.out.println("=======异常抛出增强start=========");
        System.out.println(target + "的" + method.getName() + "方法抛出的异常是" + e.getMessage());
        System.out.println("=======异常抛出增强end=========");
    }
}
